package com.example.demo.controller.coreport;

import com.example.demo.service.coreport.CoreportService;
import com.example.demo.vo.ResultVO;
import com.example.demo.vo.coreport.CoreportPreVO;
import com.example.demo.vo.coreport.CoreportInfoVO;
import com.example.demo.vo.coreport.CoreportReplyVO;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/coreport")
public class CoreportController {
    @Resource
    CoreportService coreportService;

    @PostMapping("/submitCoreport")
    public ResultVO<CoreportInfoVO> submitCoreport(@RequestBody CoreportInfoVO coreportInfoVO){
        return coreportService.submitCoreport(coreportInfoVO);
    }

    @GetMapping("/getCoreportListByRid")
    public ResultVO<List<CoreportReplyVO>> getCoreportListByRid(@RequestParam("rid") int rid,@RequestParam("pageNum") int pageNum){
        return coreportService.getCoreportListByRid(rid,pageNum);
    }

    //获得协作报告
    @GetMapping("/getCoreportByCoid")
    public ResultVO<CoreportPreVO> getCoreportByCoid(@RequestParam int coid){return coreportService.getCoreportByCoid(coid);}
}